#pragma once
#include "d3dutil.h"
#include "LevelElement.h"
#include "Vertex.h"
#include <vector>

using namespace std;
class FullscreenQuad
{
public:
	public:
	FullscreenQuad(const tstring& TexFileName, Level* level);
	virtual ~FullscreenQuad(void);

	virtual void Initialize(ContentManager *pContentManager);
	virtual void Draw()const; 
	virtual void Draw(const RenderContext* pRenderContext); 	
	virtual void SetTexture(ID3D10ShaderResourceView * texture){
		m_pTextureRV = texture;
		UpdateEffectVariables();
	}
protected:
	virtual void FillVertexAndIndexBuffer();
	virtual void GetEffectVariables();
	virtual void DefineInputlayout();
	virtual void UpdateEffectVariables()const;
	virtual void LoadTexture(const tstring& TexFileName);
	
	void BuildStacks(vector<VertexPosTex>& vertices, vector<DWORD>& indices);

	// Loads and compiles the effect and gets the technique
	virtual void CreateEffect(const tstring& EffectFilename);

	int m_NumVertices,m_NumIndices;	
	UINT m_VertexBufferStride;//stride value of vertex buffer
	

	ID3D10EffectShaderResourceVariable* m_pTextureMapVariabele;
	ID3D10ShaderResourceView *		m_pTextureRV;
	ID3D10InputLayout*			m_pVertexLayout;
	ID3D10Buffer*				m_pVertexBuffer;
	ID3D10Buffer*				m_pIndexBuffer;
	ID3D10Effect*				m_pEffect;
	ID3D10EffectTechnique*		m_pDefaultTechnique;
	Level* m_pLevel;
	ContentManager* m_pContentManager;

	const tstring m_TextureName;
	FullscreenQuad(const FullscreenQuad& FullscreenQuadRef);									
	FullscreenQuad& operator=(const FullscreenQuad& FullscreenQuadRef);	
};

 
